
/**
** \file       rules.h
**
** \brief      declaration of the function linked with the parsing
**
** \authors    Ben M'rad Hanna, Boillot Ulysse, De Oliveira Guillaume,
**             Laterem Hamza and Nguyen Viet Dung
**
** \version    0.8
**
** \date       26 November 2010
**
*/

#ifndef RULES_H_
# define RULES_H_

# include "../lexer/token.h"
# include "../my_42sh.h"
# include "ast.h"
# include "free_parser.h"
# include "../exec_cmdline.h"

/**
** \fn         rule_input rule_list rule_and_or rule_command rule_until
**             rule_case rule_for rule_dogroup rule_else_clause
**             rule_case_clause rule_pipeline rule_if rule_funcdec
**             rule_simple_command rule_compound_list rule_redirection
**             rule_while rule_prefix rule_shell_command
**
**
** \brief      all these function are associated to a rule of the grammar
**             the parser follows these rules to fill the AST
**
** \param      all these functions got 1 arg. The node of the AST
**             it has to fill.
**
** \return     all these functions return a node of the AST, NULL if it failed.
**
*/

s_ast                   *rule_input(s_ast                       *ast);

s_list                  *rule_list(s_list                       *list);

struct andor            *rule_and_or(struct andor               *andor);

s_command               *rule_command(s_command                 *cmd);

s_ruleuntil             *rule_until(s_ruleuntil                 *until);

s_rulecase              *rule_case(s_rulecase                   *rcase);

s_rulefor               *rule_for(s_rulefor                     *rfor);

s_dogroup               *rule_do_group(s_dogroup                *group);

s_caseclause            *rule_case_clause(s_caseclause          *cclause);

s_caseitem              *rule_case_item(s_caseitem              *citem);

s_element               *rule_element(s_element                 *element);

s_cmpdlist              *rule_compound_list(s_cmpdlist          *cmpdl);

s_smp_cmd               *rule_simple_command(s_smp_cmd          *smp_cmd);

s_pipeline              *rule_pipeline(s_pipeline               *pipe);

struct else_clause      *rule_else_clause(struct else_clause    *eclause);

s_funcdec               *rule_funcdec(s_funcdec                 *funcdec);

s_ruleif                *rule_if(s_ruleif                       *rif);

s_redir                 *rule_redirection(s_redir               *redir);

s_rulewhile             *rule_while(s_rulewhile                 *rwhile);

s_prefix                *rule_prefix(s_prefix                   *pref);

s_sh_cmd                *rule_shell_command(s_sh_cmd            *sh_cmd);

#endif /* !RULES_H_ */
